/*
    This file is part of the Time-of-Flight Tracer program. It is not part of
    the original PBRT source distribution. See the included license file for
    more information.

    Copyright(c) 2014 Microsoft Corporation

    Author: Phil Pitts
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef PBRT_FILM_BACKSCATTER_H
#define PBRT_FILM_BACKSCATTER_H

#include "pbrt.h"
#include "film.h"
#include "sampler.h"
#include "paramset.h"

class BackscatterFilm : public Film {
public:
	BackscatterFilm(int xres, int yres, const string &filename);
	virtual ~BackscatterFilm();

	virtual void AddSample(const CameraSample &sample, const PaintData &paint) = 0;
	virtual void Splat(const CameraSample &sample, const PaintData &paint) = 0;
	virtual void WriteImage(float splatScale) = 0;

	virtual void GetSampleExtent(int *xstart, int *xend, 
		int *ystart, int *yend) const;
	virtual void GetPixelExtent(int *xstart, int *xend, 
		int *ystart, int *yend) const;
	virtual void UpdateDisplay(int x0, int y0, int x1, int y1, float splatScale);

protected:
	HistogramSample* GetHistogramSample(const CameraSample &sample);
};

void GetBackscatterParams(ParamSet params, int *xres, int *yres, string *filename);

#endif // PBRT_FILM_BACKSCATTER_H
